<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 *
 * @author chuck
 */

class Translate
{
    public static $en_arr = array(
        "help" => "help",
        "attack" => "help",
        "You got a present!" => "You got a present!",
        "gave you a gift!"=>"gave you a gift!",
        "Help out your friend!" =>"Help out your friend!",
        "asks you to send a life!" =>"asks you to send a life!"
    );
    public static $cn_arr = array(
        "help" => "帮助",
        "attack" => "攻击",
        "You got a present!" => "You got a present!",
        "gave you a gift!"=>"gave you a gift!",
        "asks you to send a life!" =>"asks you to send a life!"
    );

    public static function tran($str, $type)
    {
        $ary = array();
        if ($type == "en") {
            $ary = self::$en_arr;
        } else if ($type == "cn") {
            $ary = self::$cn_arr;
        }
        if (isset($ary[$str])) {
            return $ary[$str];
        } else {
            return $str;
        }
    }
}

?>
